package com.example.service.impl;

import com.example.dao.UserDao;
import com.example.dao.impl.UserDaoImplForMySQL;
import com.example.dao.impl.UserDaoImplForOracle;
import com.example.service.UserService;

public class UserServiceImpl implements UserService {
    // 不仅仅是重写一个方法，定义成成员变量
    // private UserDao userDao = new UserDaoImplForMySQL();
    // private UserDao userDao = new UserDaoImplForOracle();
    private UserDao userDao;

//    public void setUserDao(UserDao userDao) {
//        this.userDao = userDao;
//    }
//
//    public UserServiceImpl(UserDao userDao) {
//        this.userDao = userDao;
//    }

    // 业务层调用持久层对象，执行删除数据，需要一个持久层对象
    @Override
    public void deleteUser() {
        userDao.deleteByID();
    }
}
